/***************************************************************************
 *  -- Copyright Bit Armory Labs 2007
 *
 * FILE:     NamespaceTemplateFactory.cs, 45 code lines, [1.58 KB]
 * DATE:     8/26/2007 5:58 PM
 * MODIFIED: 8/26/2007 5:59 PM
 * PATH:     C:\Programming\Projects\Slinks\Slinks.Resources
 *
 * NAMESPACE: Slinks.Generator
 * CLASS:     NamespaceTemplateFactory
 *
 * AUTHOR:   Brian Chavez (Cowboy), bchavez@bitarmory.com
 *
 *                        Licence
 *
 * This library, code generator, and source code
 * is licensed under the terms and conditions defined in the GNU Public
 * License. You are free to use it for non-commercial purposes.
 * If you are going to use any part of it in a commercial 
 * application, contact me and we can work something out.
 * You may use the code generated output of Slink and Slink
 * as a development tool in both commercial and 
 * non-commercial applications.
 *
 * THE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS", WITHOUT WARRANTY
 * OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHOR BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THIS
 * SOFTWARE.
 ***************************************************************************/

using System;
using TaHoGen.Generators;
using TaHoGen;
namespace Slink.Generator
{
    /// <summary>
    /// Namespace template factory
    /// </summary>
    public class NamespaceTemplateFactory
    {

        /// <summary>
        /// Class template type
        /// </summary>
        private static Type namespaceTemplateType = null;

        /// <summary>
        /// Create class template factory
        /// </summary>
        static NamespaceTemplateFactory()
        {
            NamespaceTemplateFactory.namespaceTemplateType = TemplateFactory.GetTemplateGeneratorType( System.Text.ASCIIEncoding.ASCII.GetString( Properties.Resources.NamespaceTemplate ) );
        }

        /// <summary>
        /// Create class text generator
        /// </summary>
        public static TextGenerator CreateNamespaceTextGenerator( string folderNamespace, TextGenerator classTextGeneratorsInNamespace )
        {
            PropertyTable pt = new PropertyTable();
            pt["FolderNamespace"] = folderNamespace;
            pt["ClassTextGenerators"] = classTextGeneratorsInNamespace;

            TextGenerator namespaceTextGenerator = TemplateFactory.CreateTextGenerator( NamespaceTemplateFactory.namespaceTemplateType, pt );

            return namespaceTextGenerator;
        }
    }
}
